import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text("Event And Notification Widget Demo"),
      ),
      body: const GestureScaleWidget(),
    ),
  ));
}

class GestureScaleWidget extends StatefulWidget {
  const GestureScaleWidget({Key? key}) : super(key: key);

  @override
  _GestureScaleWidgetState createState() => _GestureScaleWidgetState();
}

class _GestureScaleWidgetState extends State<GestureScaleWidget> {

  double _width = 200.0;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: GestureDetector(
        child: Image.asset("assets/images/avatar.png", width: _width,),
        onScaleUpdate: (ScaleUpdateDetails details) {
          setState((){
            _width = 200 * details.scale.clamp(.8, 10.0);
          });
        },
      ),
    );
  }
}
